<template>
  <el-calendar>
    <template #date-cell="{ data }">
      <p >
  
  {{ data.day.split('-').slice(1).join('-') }}
        <div v-for="(item,index) in time.filter(item => item.created_at.split(' ')[0]=== data.day)" :key="index">
          No:{{item.order_no  }}
        </div>
      </p>
    </template>
  </el-calendar>
</template>

<script setup>
import { calendar } from '@/api/order.js';
import { ref } from 'vue';

const time = ref([]);

function getDate() {
  calendar().then(res => {
    time.value = res.data;
  });
}

// function getOrderNos(date) {
//   console.log(date)
//   return time.value.filter(item => item.created_at.split(' ')=== date).map(item => item.order_no);
// }

getDate();
</script>

<style>
.is-selected {
  color: #1989fa;
}
.el-calendar-table{
 height: 100vh;
}
</style>
